package com.example.shushiyunsst.fragment.main.home.child.miner22.bean

import com.example.shushiyunsst.R
import com.example.wallet.global.AppGlobals
import java.io.Serializable

data class CMLIntent(
    val address: String,
    var cmlCount: String,

    val iconType:String,
    val accountType:String,
    val transferType: Int
) : Serializable {

    var balanceCny:String="0"

    companion object{
        //父账户
        const val PARENT_ACCOUNT = 0

        //母币账户
        const val MOTHER_ACCOUNT = 3

        //子账户
        const val CHILD_ACCOUNT = 1
    }

    fun cmlBalanceStr(): String? {

        return "$cmlCount $iconType"
    }

    fun cnyBalanceStr(): String? {
        val context = AppGlobals.getApplication()
        val approximately = context.getString(R.string.wallet_approximately)
        val cny = context.getString(R.string.wallet_cny)
        if (transferType==PARENT_ACCOUNT){
               return "$approximately $balanceCny $cny"
        }
        return "$approximately $cmlCount $cny"
    }
}